import request from '@/utils/request'

export function getRoleList (params) {
  return request({
    url: '/sys/role',
    method: 'GET',
    params
  })
}

export function addRoleList (data) {
  return request({
    url: '/sys/role',
    method: 'POST',
    data
  })
}

export function updateRole (data) {
  return request({
    url: '/sys/role/' + data.id,
    method: 'PUT',
    data
  })
}

export function delRole (id) {
  return request({
    url: '/sys/role/' + id,
    method: 'DELETE'
  })
}

export function getRoleDetail (id) {
  return request({
    url: '/sys/role/' + id,
    method: 'GET'
  })
}

// 分配权限角色
export function assignPrem (data) {
  return request({
    url: '/sys/role/assignPrem',
    method: 'PUT',
    data
  })
}

